import http from '@/http';
import {type SaveRoleMenuParm, type SysRole, type SysRoleQueryParam} from './RoleModel';

//新增角色
export const addApi = (parm: SysRole) => {
    return http.post('/api/role', parm);
};
//查询角色
export const getListApi = (parm: SysRoleQueryParam) => {
    return http.get('/api/role/getList', parm);
};
//删除角色
export const deleteApi = (roleId: string) => {
    return http.delete(`/api/role/${roleId}`);
};
//修改角色
export const editApi = (parm: SysRole) => {
    return http.put('/api/role', parm);
};
//获取角色下拉列表
export const getSelectApi = () => {
    return http.get('/api/role/selectList');
};
//为角色分配菜单
export const saveRoleMenuApi=(parm:SaveRoleMenuParm)=>{
    return http.post('/api/role/saveRoleMenu',parm)
}
